﻿package com.Galaxisfarm {
	// Bibliotecas da game engine Flixel
	import com.adamatomic.flixel.*;
	
	public class CreditsState extends GameState {
		// Logo TECPAR 70
		[Embed(source = "../../data/logotipotecpar70.png")] protected var ImgLogoTecpar:Class;
		
		// Método construtor
		public function CreditsState():void {
			// Adiciona o background no palco
			var backgroundCerrado:BackgroundCerrado = new BackgroundCerrado(20, 20);
			backgroundCerrado.play("animate");
			_lyr_stage.add(backgroundCerrado);
			
			// Créditos
			_lyr_sprites.add(new FlxText(0, 40, FlxG.width, 80, "Créditos", 0xffffffff, null, 26, "center"));
			
			// Textos
			_lyr_sprites.add(new FlxText(35, (FlxG.height / 2) - 124, 640, 60, "Equipe envolvida, Divisão de Inteligência Artificial do TECPAR:", 0xffffffff, null, 16, "left"));
			_lyr_sprites.add(new FlxText(35, (FlxG.height / 2) - 84, 640, 60, "  Bruno Campagnolo de Paula - Coordenação e game design;", 0xffffffff, null, 16, "left"));
			_lyr_sprites.add(new FlxText(35, (FlxG.height / 2) - 64, 640, 60, "  Diego Cabral - Ilustrações e design de personagens;", 0xffffffff, null, 16, "left"));
			_lyr_sprites.add(new FlxText(35, (FlxG.height / 2) - 44, 640, 60, "  Patrick Espake - Programação;", 0xffffffff, null, 16, "left"));
			_lyr_sprites.add(new FlxText(35, (FlxG.height / 2) - 24, 640, 60, "  Roberta Zuge - Consultoria veterinária;", 0xffffffff, null, 16, "left"));
			
			// Botão voltar
			_lyr_sprites.add(new FlxButton((FlxG.width / 2) - 104, (FlxG.height / 2) + 40, new FlxSprite(null, 0, 0, false, false, 104, 25, 0xff25155E), onClickBack, new FlxSprite(null, 0, 0, false, false, 104, 25, 0xffE46713), new FlxText(0, 1, 104, 25, "Voltar", 0xffffff, null, 16, "center"), new FlxText(0, 1, 104, 25, "Voltar", 0xffffff, null, 16, "center")));
			
			// Logo TECPAR 70
			_lyr_sprites.add(new FlxSprite(ImgLogoTecpar, 525, 212));
		}
		
		// Método chamado para voltar ao menu
		private function onClickBack():void {
			// Muda o estado do jogo para o menu
			FlxG.switchState(MenuState);
		}
	}
}